/*
 * Copyright (c) 2018 maoyan.com
 * All rights reserved.
 *
 */
package com.darren.euc.repository;

import com.darren.euc.entity.Activity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * 在这里编写类的功能描述
 *
 * @author fangwenhao
 * @created 2018/3/13
 */
public interface ActivityRepository extends PagingAndSortingRepository<Activity,Long> {

    List<Activity> findTop5ByUserAreaIdInAndStatusInOrderByAddTimeDesc(List<Long> spaceIds,List<Integer> statusList);

    Page<Activity> findByUserAreaIdInAndStatusInOrderByBeginTimeDesc(List<Long> spaceIds,List<Integer> statusList, Pageable pageable);

    Page<Activity> findByUserAreaIdInAndStatusIn(List<Long> spaceIds, List<Integer> statusList, Pageable pageable);

    Page<Activity> findByIdInAndStatusInOrderByBeginTimeDesc(List<Long> ids, List<Integer> statusList, Pageable pageable);

    Page<Activity> findByIdInAndStatusIn(List<Long> ids, List<Integer> statusList,Pageable pageable);

    List<Activity> findByIdIn(List<Long> findByIdIn);

}
